<script setup>
import { reactive } from 'vue';

const data = reactive({

})
const emits = defineEmits(['jump'])
defineProps({
  list: {
    type: Array,
  }
})
const add = (id) => {
  emits('jump', id)
}

</script>
<template>
  <div class="Mbox">
    <div class="Ms" v-for="(item, index) in list" :key="index" @click="add(item.id)">
      <!-- {{list}} -->
      <div class="Mimgs">
        <img :src="item.teacher[0].avatar" alt="">
      </div>
      <span class="Nei">{{ item.title }}</span>
      <van-button type="primary" class="mbtn" color="#f15a24">免费</van-button>
      <span style="color:#f15a24">{{ item.sales_num }}报名</span>
    </div>
  </div>

</template>
<style lang="scss" scoped>
.Mbox {
  width: 100%;
  // background-color: rebeccapurple;
  height: 320px;
  display: flex;
   color: #000;
  .Ms {
    width: 250px;
    height: 300px;
    // margin-top: 40px;
    background-color: #eaeaea;
    display: flex;
    flex-direction: column;
    position: relative;
    align-items: center;
    box-sizing: border-box;
    padding: 0 20px;
    margin-left: 20px;

    .Mimgs {
      width: 90px;
      height: 90px;
      position: absolute;
      top: -50px;
      left: 85px;

      img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: 2px #f15a24 solid;
      }
    }

    .Nei {
      width: 180px;
      height: 120px;
      // background-color: aqua;
      text-align: center;
      // background-color: aqua;

      // height: 100%;
      margin-top: 55px;
      margin-bottom: 20px;
    }

    .mbtn {
      width: 150px;
      height: 50px;
      font-size: 25px;
      border-radius: 30px;
      margin-bottom: 10px;
    }
  }
}
</style>